import { FilterConst } from "../../../component/gconst/FilterConst";
import { ObjCreate } from "../common/ObjCreate";
import { LoaderHelp } from "../../../common/display/LoaderHelp";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
type int = number;
//class CrossTaskHardLevel
    
    export  class CrossTaskHardLevel /* flash.display.Sprite */
    {
        constructor(arg1: int=5, arg2: string="GuildResourceAllocationStarBtn", arg3: string="GuildResourceAllocationStarBtn_upSkin")
        {
            
            this._resName = arg2;
            this._skinName = arg3;
            this._num = arg1;
            this.initView();
            return;
        }

        public get lightStarNum(): int
        {
            return this._lightStarNum;
        }

        public set lightStarNum(arg1: int)
        {
            var loc2=null;
            this._lightStarNum = arg1;
            var loc1=0;
            while (loc1 < this._stars.length) 
            {
                loc2 = this._stars[loc1];
                if (loc1 < this._lightStarNum) 
                {
                    loc2.filters = [];
                }
                else 
                {
                    loc2.filters = [FilterConst.colorFilter];
                }
                ++loc1;
            }
            return;
        }

        protected initView(): void
        {
            this._stars = [];
            var loc1=0;
            while (loc1 < this._num) 
            {
                this._stars.push(ObjCreate.createBitmap(null, loc1 * 17, 0, this));
                ++loc1;
            }
            LoaderHelp.addResCallBack(this._resName, this.onGetRes);
            return;
        }

        protected onGetRes(): void
        {
            var loc1=0;
            while (loc1 < this._num) 
            {
                flash.display.Bitmap(this._stars[loc1]).bitmapData = GlobalClass.getBitmapData(this._skinName);
                ++loc1;
            }
            return;
        }

        protected /* var */_stars: Array<any>;

        protected /* var */_num: int;

        protected /* var */_skinName: string;

        protected /* var */_resName: string;

        protected /* var */_lightStarNum: int;
    }
